package cn.dengta.webapp.user.form;

import cn.dengta.common.model.Status;
import cn.dengta.common.validator.Check;
import cn.dengta.context.model.WesKit;
import cn.dengta.webapp.base.form.BaseForm;
import lombok.*;

@Getter
@Setter
public class ToggleForm extends BaseForm<Void> {

	@Check(value = "ID", i18n = false)
	public Long id;
	@Check(value = "state", i18n = false)
	public Integer state;
	public String remark;
	//
	@Setter(AccessLevel.NONE)
	public boolean enabled;

	public WesKit wesKit;

	@Override
	public void preHandle() {
		enabled = Status.asResult(state);
	}

	public void setWesKit(String wesKit) {
		this.wesKit = WesKit.valueOf(wesKit);
	}

}
